package com.wuyou.pojo;

import java.io.Serializable;

/**
 * @author 闵洪友
 */
public class PageBean implements Serializable {
    private int countPage;//总页数
    private int countSize;//总记录数
    private int pageSize=3;//每页显示的记录数
    private int currentPage;//当前页
    private int startSize;//每页的开始
    private int endSize;//每页的结束
    private ReQuery reQuery;//条件查询
    public int getCountPage() {
        if (getCountSize()%getPageSize()==0){
            countPage=getCountSize()/getPageSize();
        }else{
            countPage=getCountSize()/getPageSize()+1;
        }
        return countPage;
    }

    public void setCountPage(Integer countPage) {
        this.countPage = countPage;
    }

    public int getCountSize() {
        return countSize;
    }

    public void setCountSize(int countSize) {
        this.countSize = countSize;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getStartSize() {
        startSize=(getCurrentPage()-1)*getPageSize();
        return startSize;
    }

    public void setStartSize(int startSize) {
        this.startSize = startSize;
    }

    public int getEndSize() {
        endSize=getCurrentPage()*getPageSize();
        return endSize;
    }

    public void setEndSize(int endSize) {
        this.endSize = endSize;
    }

    public void setCountPage(int countPage) {
        this.countPage = countPage;
    }

    public ReQuery getReQuery() {
        return reQuery;
    }

    public void setReQuery(ReQuery reQuery) {
        this.reQuery = reQuery;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "countPage=" + countPage +
                ", countSize=" + countSize +
                ", pageSize=" + pageSize +
                ", currentPage=" + currentPage +
                ", startSize=" + startSize +
                ", endSize=" + endSize +
                ", reQuery=" + reQuery +
                '}';
    }
}
